/**
 * Created by ss on 2015/1/27.
 */
(function ($) {
    //分页
    if (oPageConfig.page_c === '0') {
        return false;
    } else {
        $(".tcdPageCode").createPage({
            //pageCount：总页数
            //current：当前页
            pageCount: parseInt(oPageConfig.page_c),
            current: parseInt(oPageConfig.page_u),
            backFn: function (p,id) {
                if (oPageConfig.id === '') {
                    $.get(oPageConfig.oUrl, {
                        P: p
                    }, function (data) {
                        window.location.href = location.hash + '?P=' + p;
                        $(document).find("html").html(data);
                    });
                } else {
                    $.get(oPageConfig.oUrl, {
                        P: p,
                        id: oPageConfig.id
                    }, function (data) {
                        window.location.href = location.hash + '?P=' + p + '&id=' + oPageConfig.id;
                        $(document).find("html").html(data);
                    });
                }
            }
        });
    }
})(jQuery);